﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace MyDemos.Demos
{
    public partial class AnimationDemo : PhoneApplicationPage
    {
        public AnimationDemo ()
        {
            InitializeComponent ();
        }


        private void button2_Click (object sender, RoutedEventArgs e)
        {
            Storyboard story = new Storyboard ();
            cBorder.RenderTransform = new RotateTransform ();
            cBorder.Projection = new PlaneProjection ();




            DoubleAnimation animation = new DoubleAnimation ();
            animation.From = 0;
            animation.To = 360;
            animation.Duration = new Duration (TimeSpan.FromMilliseconds (3000));
            Storyboard.SetTarget (animation, cBorder.Projection);
            Storyboard.SetTargetProperty (animation, new PropertyPath ("(RotationX)"));
            animation.FillBehavior = FillBehavior.Stop;

            story.Children.Add (animation);

            animation = new DoubleAnimation ();
            animation.From = 0;
            animation.To = 360;
            animation.Duration = new Duration (TimeSpan.FromMilliseconds (3000));
            Storyboard.SetTarget (animation, cBorder.RenderTransform);
            Storyboard.SetTargetProperty (animation, new PropertyPath ("(Angle)"));
            animation.FillBehavior = FillBehavior.Stop;





            story.Children.Add (animation);


            story.Begin ();
            
           // cBorder.
        }
    }
}